package com.beans;

import org.hibernate.Session;

import com.hibernate.util.HibernateUtil;

public class TestBeans {
	public static void main(String[] args){
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		
		User user = new User();
		user.setName("Vincent");
		session.save(user);
		
		User user2 = new User();
		user2.setName("Cyril");
		session.save(user2);
		
		session.getTransaction().commit();
		HibernateUtil.getSessionFactory().close();
	}
}
